home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / INFO / DOSTRAIN.ZIP / NOTES.DOC < prev    next >
Text File  |  1988-09-07  |  12KB  |  241 lines

  1.                                    DOS CONCEPTS
  2.  
  3.  
  4.          The material on this disk is used to introduce the concept  of  a
  5.          program,     the     basic    components    of    the    computer
  6.          (input/output/memorystorage/CPU),  the operating system,  and the
  7.          relationship between a programs and data (in memory and on disk).
  8.  
  9.               I.   Demonstration Programs (*.EXE)
  10.               II.  Source Programs (*.BAS)
  11.               III. Handouts (*.HDT)
  12.               IV.  Assignments (*.AST)
  13.               V.   Data Files (*.DAT)
  14.  
  15.          I.  Demonstration Programs
  16.  
  17.          The  following  are descriptions of the demo programs on the disk
  18.          (in the order in which I introduce them):
  19.  
  20.          PONG.EXE This program is used to illustrate loading and execution
  21.               of a program,  followed by return to the  operating  system.
  22.               It needs no explanation, and loosens beginners up.  I use it
  23.               the first class meeting, and lecture on the flow of informa-
  24.               tion from storage to memory as the program is loaded and the
  25.               transfer of control from the operating system to the program
  26.               then back to the operating system.
  27.  
  28.          MORTGAGE.EXE This program computes mortgage payments, etc.  It is
  29.               self-explanatory,  but the user interface is rather poor.  I
  30.               use it as a jumping off point for a discussion of the neces-
  31.               sity of carefully reading screen  output  and  instructions,
  32.               the  need  to  be skeptical of computer results,  sources of
  33.               computer system error,  and user interfaces and how this one
  34.               could be improved (see assignment 1).   In other words, this
  35.               program is good because it's bad.
  36.  
  37.          TTT.EXE This is a tic-tac-toe program.   It makes the same points
  38.               as  PONG,  but is a better illustration of the idea of a se-
  39.               quentially executed program.   I hand out a flowchart of the
  40.               program as well as an assignment designed to get the student
  41.               to  think  of it as a list of sequentially executed instruc-
  42.               tions.
  43.  
  44.          PLAY.EXE This program is a tune editor,  which can be  used  ini-
  45.               tally without saving/restoring tunes (i.  e.  without intro-
  46.               ducing the idea of a data file).   A second  assignment  can
  47.               involve storing and restoring tunes.   Unlike MAKEFILE,  the
  48.               internal file structure is different than  the  screen  dis-
  49.               play, which helps the student form a more general picture of
  50.               the  relationship between a program and a data file.   PLAY,
  51.               unlike the others,  requires a little documentation  (a  two
  52.               page tutorial and/or a one-page reference).
  53.  
  54.          MAKEFILE.EXE  I  use  this program as a first illustration of the
  55.               idea of a data file, as opposed to a program file.  The user
  56.               types in whatever he or she wishes  (e.  g.  a  joke),  then
  57.               saves it in a file which can be printed (using PrtSc),  dis-
  58.               played, copied, erased, etc.
  59.  
  60.  
  61.          II.  Source Programs
  62.  
  63.          The source programs are for the instructors use and modification.
  64.          I only use the compiled versions in class,  because I do not wish
  65.          to  introduce BASIC interpreter and it's relationship to the rest
  66.          of the system in the early class meetings.
  67.  
  68.          PONG.BAS Source code for PONG,  feel free to recompile it with  a
  69.               different game "title" or whatever.
  70.  
  71.          MORTGAGE.BAS  Source code for MORTGAGE.   This was taken from the
  72.               IBM DOS disk.  THIS IS NOT PUBLIC DOMAIN MATERIAL!.  USE THE
  73.               COPY ON YOUR DOS DISKETTE!
  74.  
  75.          PLAY.BAS When a hard disk crashed,  I lost my only  copy  of  the
  76.               source to this program.  I am sorry that I cannot give it to
  77.               you.
  78.  
  79.          TTT.BAS  Source code for TTT.   TTT was originally developed as a
  80.               case study in a programming course.  Therefore,  I also have
  81.               a discussion and explication of the structure of the program
  82.               on a subroutine by subroutine basis, and a list of exercises
  83.               involving modification to the program.
  84.  
  85.          MAKEFILE.BAS Source code for MAKEFILE.
  86.  
  87.          III.  Handouts
  88.  
  89.          OSCOMM.HDT  This  file is a manual for a DOS subset.   It neither
  90.               covers all the commands and constructs nor presents  all  of
  91.               the options for the commands it does cover.   It is meant to
  92.               be the minimum needed to run canned application programs and
  93.               do light BASIC programming.   This subset is enough  to  get
  94.               through  the  course,  but the student is encouraged to read
  95.               the manual or other sources for enrichment.
  96.  
  97.  
  98.               The topics summarized in the handout are:
  99.  
  100.                    Drive Identifiers and File Names
  101.                    Wildcards
  102.                    Path names
  103.                    The commands:
  104.                        DIR
  105.                         TYPE
  106.                         ERASE
  107.                         RENAME
  108.                         <Program Name> (Load and execute the program)
  109.                         FORMAT
  110.                         COPY
  111.                         CHDIR
  112.                         PrtSc
  113.                         Ctrl-p
  114.                         Ctrl-Alt-Del
  115.  
  116.          TTTFLOW.HDT The text for a flowchart of the TTT  program.    This
  117.               can be used as a handout (you have to draw the boxes and ar-
  118.               rows)  to  illustrate the idea of a program's sequential ex-
  119.               ecution.   The assignment TTTFLOW.AST can be used with  this
  120.               handout.
  121.  
  122.          PLAY.HDT A tutorial and manual for the tune editor PLAY.EXE.
  123.  
  124.          IV.  Assignments
  125.  
  126.          TTT.AST Usage: This assignment is to familiarize the student with
  127.               the  components  of  the computer and the idea of a program.
  128.               The most interesting questions are  the  one  on  the  move-
  129.               choice algorithm and the mortgage questions.
  130.  
  131.          Move-choice:    In  discussing this,  students invariably suggest
  132.               strategies which are vague,  incomplete and anthropomorphic.
  133.               The solution illustrates the nature of a simple program.
  134.  
  135.          Mortgage:    If you use commas in the input values,  this program
  136.               truncates the numbers (i.  e.  100,000.00 would be  read  as
  137.               100).    That makes for ridiculous answers,  which some stu-
  138.               dents blithly turn in, opening up a discussion of GIGO,  the
  139.               need to be careful in using computer output,  programmer er-
  140.               rors, user errors, and hardware errors.
  141.  
  142.          The output is also difficult to interperet,  opening up a discus-
  143.               sion  of  program  design.    We discuss the redesign of the
  144.               program in order to better present the results and catch  or
  145.               avoid  input errors.   The students come up with good ideas,
  146.               and this reinforces the idea of a program.
  147.  
  148.          Answers:
  149.  
  150.          1.  Run the TTT program and answer the following questions:
  151.  
  152.          What has the computer been programmed to do if you try moving  to
  153.               a square that is already taken?
  154.  
  155.          Display the message indicating that the square is occupied.
  156.  
  157.          What  has the computer been programmed to do if you try moving to
  158.               a square that does not exist, like square 10?
  159.  
  160.          Display a message indicating that the legal moves are 1-9 only.
  161.  
  162.          What has the computer been programmed to do if you try  something
  163.               really strange, like moving to square HOHO?
  164.  
  165.          Display a message indicating that the legal moves are 1-9 only.
  166.  
  167.          What  has the computer been programmed to do if you hold down the
  168.               CTRL key and type the letter C while playing the game?
  169.  
  170.          Immediately stop execution of the application program and  return
  171.               control to the operating system, which displays its prompt.
  172.  
  173.          How  has  the  computer  been programmed to choose its next move?
  174.               You can spot the programmed pattern by playing several games
  175.               and watching what it does.   Your answer should not be vague
  176.               or incomplete.
  177.  
  178.          Take the center if it is open,  otherwise take a corner, or if no
  179.               corners are open take a side.  The ordering of priorities is
  180.               5, 1, 3, 7, 9, 2, 4, 6, 8.
  181.  
  182.          2.  Run the MORTGAGE program, and answer the following questions:
  183.  
  184.          What is the monthly payment for a loan of $12,352 for 7 years  at
  185.               an interest rate of 13%.
  186.  
  187.                $224.71
  188.  
  189.          If you borrow $100,000 at 13% for 30 years,  your monthly payment
  190.               is $1,106.20.   In the 319th month,  how much of the payment
  191.               goes for interest and how much for principle?
  192.  
  193.                Int:  $402.65, prin: $703.55
  194.  
  195.          PLAY.AST  This  assignment  further  illustrates  the use of pre-
  196.               written program, the keyboard,  and the relationship between
  197.               the  application program and operating system.   It requires
  198.               that the user read  a  manual,  since  I  only  describe  it
  199.               briefly in class before making the assignment.
  200.  
  201.               Usage:
  202.  
  203.          This assignment also prepares the student for a discussion of the
  204.               distinction  between  a  program  and data (in memory and on
  205.               disk).   After they have done this assignment,  I  ask  them
  206.               where the tune "is" while you are working on it.  Discussing
  207.               that  question  leads to the idea that the operating system,
  208.               the application program, and the data the program is working
  209.               with are all in memory while the program executes.
  210.  
  211.          Next, I ask what would happen if they were interrupted and wanted
  212.               to save the tune they were working on;  where  would  it  be
  213.               saved?  That leads to the concept of a data file in storage.
  214.  
  215.          MAKEFILE.AST  This  assignment  follows  up on the idea of a data
  216.               file,  requiring that they create one themselves.   It  also
  217.               introduces the DIR and TYPE operating system commands,  as a
  218.               lead in to the next assignment.
  219.  
  220.          Students must be shown how to format a disk  before  giving  them
  221.               this assignment.
  222.  
  223.          DOS.AST  This assignment gives practice with the operating system
  224.               commands and solidifies the  concept  of  data  and  program
  225.               files.
  226.  
  227.          TTTFLOW.AST This assignment illustrates flowcharting and the idea
  228.               of a sequentially executing program.   It requires the flow-
  229.               chart in TTTFLOW.HDT.   This assignment is also useful  when
  230.               introducing programming.
  231.  
  232.  
  233.          V.  Data files
  234.  
  235.          STRUC.DAT  A small structured file to introduce the idea of files
  236.               and exercise DOS commands.   You can also informally  intro-
  237.               duce the ideas of records and fields if you wish.
  238.  
  239.          TEXT.DAT A small test file to introduce the idea of files and ex-
  240.               ercise DOS commands.
  241.